package top.zhan.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * 具体的容器，简化版本
 * @author Zhan
 * @date 2022/10/9 19:10
 */
public class MyCollection implements ICollection{

    private List list = new ArrayList<>();

    @Override
    public void add(Object obj) {
        list.add(obj);
    }

    @Override
    public void remove(Object obj) {
        list.remove(obj);
    }

    @Override
    public Iterator iterator() {
        return new ConcreteIterator(list);
    }
}
